{strip}
{include file="common/header.tpl"}
<section class="main">
    <article class="right-col">      
        <h2>{$language.title.contract} &raquo; <a href="{$smarty.const.HOST_BACKEND}contract/add?personalid={if isset($intPersonalId)}{$intPersonalId}{/if}">{$language.ahref.add}</a></h2>
        <form name="frmSearch" id="frmSearch" action="{$smarty.const.HOST_BACKEND}contract/index" onsubmit="javascript:return actionSearch();" method="get" enctype="multipart/form-data">        
            {include file="contract/search.tpl"}
        </form>
        
        <form id="frmcontract" name="frmcontract" method="post" action="{$smarty.const.HOST_BACKEND}contract/act" enctype="multipart/form-data">
            <input type="hidden" name="paction" id="paction" />
            <input type="hidden" name="pcancelsearch" id="pcancelsearch"/>
            <input type="hidden" name="personalid" id="personalid" value="{if isset($intPersonalId)}{$intPersonalId}{/if}"/>
            {include file="contract/button.tpl"}
            {if isset($arrResult) && is_array($arrResult)}
                <div class="s-page">
                    <strong class="total">{$language.common.total}: {$intTotal}</strong>
                    {paging total=$intTotal limit=$intLimit offset=$intOffset}
                </div>
            {/if}
            <table width="100%" cellpadding="0" cellspacing="0" border="0" class="list">
                <thead>
                    <tr>
                        <th class="16"><input type="checkbox" name="pcheckall" id="pcheckall" onclick="javascript:checkAll(this.form,'pcontractid[]',this.checked);"/></th>
                        <th class="150">{$language.label.fee}</th>                                                <th class="80">{$language.label.signed}</th>                        						                        
                        <th class="80">{$language.label.expiry}</th>  
                        <th class="80">{$language.label.status}</th>                        
						<th class="150">{$language.label.salary_in_week}</th>                                       						
                        <th>&nbsp;</th>
                    </tr>
                </thead>
                <tbody>
                    {if isset($arrResult)}
                    {foreach key=i item=item from=$arrResult}
						<tr>
							<td align="center"><input type="checkbox" name="pcontractid[]" id="pcontractid{$item.contractid}" value="{$item.contractid}"/></td>														
							<td class="150">{$item.fee}</td>							
							<td class="80">{$item.signed}</td>						
							<td class="80">{$item.expiry}</td>	
                            <td align="center" width="16">
                                    {if $item.status == 0}
                                        <img src="{$smarty.const.HOST_STATICS}admin/img/ad-unaccept.png" width="16" height="" alt="T?m d?ng" border="0" title="T?m d?ng" />
                                    {elseif $item.status == 1}
                                         <img src="{$smarty.const.HOST_STATICS}admin/img/ad-accept.png" alt="Ðang kích ho?t" border="0" width="16" height="16" />
                                    {else}
                                        <img src="{$smarty.const.HOST_STATICS}admin/img/ad-cancel.png" alt="B? xóa" border="0" width="16" height="16" />
                                    {/if}
                            </td>  								
							<td class="150">{$item.salary_in_week}</td>                              							
							<td>                                       
                                <a href="{$smarty.const.HOST_BACKEND}contract/edit?contractid={$item.contractid}">{$language.ahref.edit}</a>
                                &nbsp;|&nbsp;     
                                
                            </td>
						</tr>
					{/foreach}
                    {/if}
                </tbody>
            </table>
            {if isset($arrResult) && is_array($arrResult)}
                <div class="s-page">
                    <strong class="total">{$language.common.total}: {$intTotal}</strong>
                    {paging total=$intTotal limit=$intLimit offset=$intOffset}
                </div>
            {/if}            
            {include file="contract/button.tpl"}
        </form>
	</article>
</section>
{include file="common/footer.tpl"}
{/strip}
                
